{ Statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=449
  Verdict: Accepted
}
uses
	SysUtils, Math;
 
var
	x1, y1, x2, y2, r1, r2, a1, a2 : double;
 
begin
	reset(input,'input.txt');
	rewrite(output,'output.txt');
	read(r1, a1, r2, a2);
	a1 := DegToRad(a1);
	a2 := DegToRad(a2);
	x1 := r1 * cos(a1);
	y1 := r1 * sin(a1);
	x2 := r2 * cos(a2);
	y2 := r2 * sin(a2);
	write(sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)):0:16);
end.